-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-8597: Added BaseSortClauseProcessor #117
Conversation
e622a5a
to
da66dfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case? Sorry, didn't catch that during the internal sync.
The use case is to avoid duplicating code to process criteria or sort clauses by media type. Criteria
SortClauses |
@ciastektk so how you're planning to utilize that feature? Could you give an example of changes for any of the mentioned duplications? I'm just not 100% sure base class in this case is the best choice. Unsure without an example. |
src/contracts/Input/Parser/Query/SortClause/BaseSortClauseProcessor.php
Outdated
Show resolved
Hide resolved
src/contracts/Input/Parser/Query/SortClause/SortClauseProcessorInterface.php
Outdated
Show resolved
Hide resolved
da66dfb
to
5967b12
Compare
4d881b8
to
9d8d85c
Compare
899ab2b
to
9e136f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming a bit late to the party. Overall +1 as the other idea I had for this issue is not well shaped even in my head and you have a working solution already ;)
What I'm missing here is some unit test coverage of that SPI (yes, it's an SPI :D ).
The implementation is "dangling", meaning that there's no actual usage in this package, thus it's not stable. What you need to do is add some stub coverage for that abstract. Happy path is enough for now.
abstract protected function getMediaTypePrefix(): string; | ||
|
||
abstract protected function getParserInvalidSortClauseMessage(string $sortClauseName): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CS: I'd probably move it even above constructor, so it's visible on the top for any consumer of that SPI. Or if you want to keep visibility precedence, then it should be at least above that private method.
9e136f5
to
65215fb
Compare
65215fb
to
177ab67
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved on IbexaDXP 4.6 commerce.
Merged up into |
Related PRs:
Description:
This PR adds
BaseSortClauseProcessor
to avoid duplicating code in several packages like:BaseSortClauseProcessor is used to parse sort clauses.
For QA:
Documentation: